Section 2: Everyone Loves ResEdit!

     Why? Because we can root around in other people's work and steal their ideas! Don't be ashamed. I do it. You'll do it. And they'll do it to you. Everything in a resource is fair game. If it's a secret, put it in your code
or in an encrypted 'TEXT' file. Everyone does that too.

'PICT' -
      The first stop in the tour of the resources of Exile is the 'PICT' resources. Exile is very unusual in the respect that ALL its graphics are kept in PICT resources. Most programmers don't do that - they store them in files or custom resources instead. I did it this way because it's very easy.
     Note how every terrain type, monster, what have you has its own PICT resource. This was my biggest mistake. I did it this way because when making dialogs, it was much easier to include a monster as a PICT in the dialog. The other alternative was having the program draw it in itself. I was too lazy to do this.
     It was a mistake. Why? Look at the info on each terrain PICT. You'll see each take 2.5 - 3 K. Each is 28x36 bytes. That's only 1008 bytes of picture info. Where'd the extra 1.5-2K come from? Well, every PICT resource also has a color table and lots of other data with it! Thus, EVERY pict has 1.5-2 K of overhead data.
     This doesn't sound like much, but when you have over 200 PICTS, as I do, it adds up FAST. It's a shareware program - people download it. Adding 300K of unnecessary data to a shareware program is a SERIOUS mistake.

     You'll also note many of the PICTs have black backgrounds. When using CopyBits transparently (something you'll want to do a lot), black was the color I masked out. This was a mistake - since the default color for the background is white, whenever I wanted to draw something transparently, I had to change the background to black by hand. Tiny mistake, but irritating.

'STR#' -
     Now for something I did right - string lists. These are very useful, esp. if you, like me, are writing a game with lots of text. They're easy to make and use. They're stored in memory very efficiently. I love them.
     The dialogue for all the towns is in here. Take a look for a while. After a bit, you'll be able to figure out the format for storing the data.
     You will also be able to read a bunch of dialogue and pick up solutions to the puzzles in the game. It's worth noting that I could easily encrypted this data to prevent this. However, why bother? I mean, if someone is stuck and wants a hint, what business do I have keeping him or her stuck at that point? 
     My job is to help people have fun. If, to keep having fun, they need to peek at the answers, I have no interest in stopping them. I also give hints to anyone who asks. It makes people happy. It's good business.

'DITL' -
      Ahh, dialogs, the boon and bane of the Mac game programmer. The modal dialog is the easiest, quickest way to create all sorts of stuff in your game. They also get on user's nerves if you use them too much. I use them a lot. People gripe at me for it all the time. Be careful.
     Looking around a bit, you will see the single most useful trick for getting a dialog to look professional - the Cover The Whole Thing With a PICT trick. Create a PICT resource looking like what you want the window to look like, and slap the sucker down on the dialog at the start. Eats up memory like hell, but users demand that the dialogs look spiffy, so we have little choice.
     By the way, the buttons in Exile are not standard Mac buttons - they're programmed by hand. I get griped at about this occasionally - I should have made them customized buttons using toolbox routines. Most people, however, don't care.

     A side note - the Human Interface Guidelines are just that - Guidelines. However, you ignore them at your peril. There are some people who will not pay you if you violate the HIG too often. You will violate them, I promise, but choose carefully when and how you do it.

'snd ' -
     Not much to say here. EVERYONE stores their sounds this way. It's the only good way, really. Spend a little bit selecting info on the sounds. Notice some are purgeable, and some aren't. The little sounds that are used all the time aren't purgeable. I load them in at the beginning, lock them down, and keep them in memory for the whole time Exile is running. The rest, I load when I play them - these MUST be purgeable, so they can be ditched when the game gets short on memory.

'BNDL' -
     Ahhhh ... where would we be without customized icons? Learn how to do this. It's a necessity. And remember - when you make the change, you need to rebuild the desktop to see it. Restart, and while the Mac is rebooting, hold down the Command and Option keys.

     It's also worth it to take a look at the specials.dat file. When you have lots of resources, storing them in a different file is a very good idea. This file contains nothing but several hundred dialogs. I give special encounter info using dialogs. It's easy. It works. Your mileage may vary. They do take a long time to make, by the way.